package org.zavgame.ejb;

import java.io.Serializable;

/**
 * The response object for the Players service response.
 * 
 * @author alexey
 *
 */
public class PlayerResponse implements Serializable
{

   /**
    * 
    */
   private static final long serialVersionUID = -1551038361499143454L;

   private String transactionId;

   private int errorCode;

   private int balanceVersion;

   private int balanceChange;

   private int balanceAfterChange;

   /**
    * Default PlayerResponse constructor.
    */
   public PlayerResponse()
   {
   }

   public PlayerResponse(String transactionId, int errorCode, int balanceVersion, int balanceChange,
      int balanceAfterChange)
   {
      this.transactionId = transactionId;
      this.errorCode = errorCode;
      this.balanceVersion = balanceVersion;
      this.balanceChange = balanceChange;
      this.balanceAfterChange = balanceAfterChange;
   }

   public String getTransactionId()
   {
      return transactionId;
   }

   public void setTransactionId(String transactionId)
   {
      this.transactionId = transactionId;
   }

   public int getErrorCode()
   {
      return errorCode;
   }

   public void setErrorCode(int errorCode)
   {
      this.errorCode = errorCode;
   }

   public int getBalanceVersion()
   {
      return balanceVersion;
   }

   public void setBalanceVersion(int balanceVersion)
   {
      this.balanceVersion = balanceVersion;
   }

   public int getBalanceChange()
   {
      return balanceChange;
   }

   public void setBalanceChange(int balanceChange)
   {
      this.balanceChange = balanceChange;
   }

   public int getBalanceAfterChange()
   {
      return balanceAfterChange;
   }

   public void setBalanceAfterChange(int balanceAfterChange)
   {
      this.balanceAfterChange = balanceAfterChange;
   }

   /**
    * Uses for logging.
    */
   @Override
   public String toString()
   {
      StringBuilder sb = new StringBuilder();
      sb.append("PlayerResponse:{")//
         .append("transactionId: ").append(transactionId).append(" ") //
         .append(", errorCode: ").append(errorCode).append(" ") //
         .append(", balanceVersion: ").append(balanceVersion).append(" ") //
         .append(", balanceChange: ").append(balanceChange).append(" ") //
         .append(", balanceAfterChange: ").append(balanceAfterChange).append(" ") //
         .append("} ");
      return sb.toString();
   }

}
